﻿using HamcoWcs.Entitys.MainTasks;
using HamcoWcs.Entitys.SubTasks;
using HamcoWcs.Models.Devices;
using HamcoWcs.Models.WcsLocations;

namespace HamcoWcs.Models.TibcoMessage.Items
{
    public class MachineAddressDto
    {
        /// <summary>
        /// 设备名
        /// </summary>
        public string MachineName { get; set; } = "";
        /// <summary>
        /// 位置名
        /// </summary>
        public string PositionName { get; set; } = "";
        /// <summary>
        /// 位置类型
        /// </summary>
        public string PositionType { get; set; } = "";
        /// <summary>
        /// 区域名
        /// </summary>
        public string ZoneName { get; set; } = "";
        /// <summary>
        /// 输送状态
        /// </summary>
        public string TransferState { get; set; } = "";

        public MachineAddressDto()
        {

        }

        public MachineAddressDto(WcsLocationDto loc) : this("CJSTW100", loc.WcsLocName, "SHELF", loc.ZoneName, "INSTK")
        {

        }

        public MachineAddressDto(SrmDto srm) : this(srm.MachineName, srm.PortName, srm.PortName, "", "MOVING")
        {

        }

        public MachineAddressDto(PconDto pcon) : this(pcon.MachineName, pcon.PortName, "PORT", "", "MOVING")
        {

        }

        public MachineAddressDto(string machineName, string positionName, string positionType, string zoneName = "", string transferState = "")
        {
            MachineName = machineName;
            PositionName = positionName;
            PositionType = positionType;
            ZoneName = zoneName;
            TransferState = transferState;
        }
    }


    public class SearchPalletModel
    {
        public string UnitId { get; set; }
    }

    public class CurrentPalletModel
    {
        public MachineAddressDto CurrentLocation { get; set; }
        public MainTask CurrentTask { get; set; }
    }
}
